package com.ljf.common.domain.repository.service;

import com.ljf.common.dto.query.PageParam;
import com.ljf.common.exception.ServiceException;

import java.util.List;

/**
 * 基础数据访问接口定义--删除部分
 *
 * @author LJF
 * @since 2024-09-29
 */
public interface IDeleteService<Q extends PageParam> {

    /**
     * 根据ID删除
     *
     * @param id
     * @return
     * @throws ServiceException
     */
    int deleteById(Long id) throws ServiceException;

    /**
     * 根据ID批量删除
     *
     * @param ids
     * @return
     * @throws ServiceException
     */
    int deleteBatchByIds(List<Long> ids) throws ServiceException;

    /**
     * 根据查询条件删除
     *
     * @param query
     * @return
     * @throws ServiceException
     */
    int delete(Q query) throws ServiceException;

    /**
     * 根据ID批量彻底删除
     *
     * @param ids
     * @return
     * @throws ServiceException
     */
    int physicalDeleteBatchByIds(List<Long> ids) throws ServiceException;

    /**
     * 根据查询条件彻底删除
     *
     * @param query
     * @return
     * @throws ServiceException
     */
    int physicalDelete(Q query) throws ServiceException;

}
